import { createStore } from 'vuex'
import user from './modules/user';
import createPersistedState from 'vuex-persistedstate';

const store = createStore({
  modules: {
    user,
  },
  plugins: [
    createPersistedState({
      key: 'app-store', // 存储键名
      // 持久化字段名称
      paths: [
        'user.token',
        'user.nickName',
        'user.orgName',
        'user.avatar',
        'user.permissions',
        'user.roles',
        'user.info',
      ] 
    })
  ]
});

export default store